<template>
  <div class="container">
    <div class="container-header">
      <ul>
        <li class="title">猜你喜欢</li>
        <li class="nav-item">为你甄选最适合的</li>
        <li class="all">全部<i class="iconfont">&#xe633;</i></li>
      </ul>
    </div>
    <div class="container-content">
      <div v-for="(item, index) of brand" :key="index" class="container-content-item">
        <div class="img-box">
          <img :src="item.picture">
        </div>
        <div class="info-box">
          <div class="title">{{item.title}}</div>
          <div class="score-container">
            <el-rate
              v-model="item.straCount"
              disabled
              text-color="#ff9900">
            </el-rate>
            <div class="comment-number">{{item.commentCount}}个评价</div>
          </div>
          <div class="desc">{{item.place}}</div>
          <div class="price-container">
            <span class="span-one">￥</span>
            <span class="span-two">{{item.price}}</span>
            <span class="span-three">起</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Like',
  data() {
    return {
      value: 3.7
    }
  },
  props: {
    brand: {
      type: Array,
      default() {
        return []
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.container {
  width: 1199px;
  padding-right: 7px;
  margin: 0 auto;
  margin-top: 30px;
  padding-bottom: 50px;
  &-header {
    width: 100%;
    height: 44px;
    line-height: 44px;
    box-sizing: border-box;
    font-size: 14px;
    color: #fff;
    border-top-right-radius: 5px;
    border-top-left-radius: 5px;
    background: linear-gradient(to right, rgb(88, 174, 221) 2%, rgb(66, 191, 205) 97%) rgb(88, 174, 221);
    ul {
      li {
        display: inline-block;
      }
      .title {
        font-size: 18px;
        margin-left: 13px;
        margin-right: 10px;
        float: left;
        padding: 0 5px;
        position: relative;
        cursor: pointer;
        text-transform: uppercase;
      }
      .nav-item {
        float: left;
        padding: 0 5px;
        position: relative;
        cursor: pointer;
        text-transform: uppercase;
        &::after {
          position: absolute;
          border-top: 6px solid transparent;
          border-left: 4px solid transparent;
          border-right: 4px solid transparent;
          border-bottom: 8px solid #fff;
          content: "";
          width: 11px;
          bottom: 0;
          right: 52px;
          height: 0;
        }
      }
      .all {
        float: right;
        margin-right: 12px;
        .iconfont {
          font-size: 13px;
          color: #fff;
        }
      }
    }
  }
  &-content {
    display: flex;
    flex-wrap: wrap;;
    background-color: #fff;
    border: 1px solid #E5E5E5;
    border-top: 0;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    max-height: 758px;
    padding: 10px 10px 20px;
    width: 100%;
    box-sizing: border-box;
    overflow-y: hidden;
    text-align: left;
    &-item {
      padding: 10px;
      display: flex;
      width: 20%;
      flex-direction: column;
      cursor: pointer;
      .img-box {
        height: 0;
        width: 100%;
        padding-bottom: 56.25%;
        background-color: #f4f4f4;
        background-image: url(//p0.meituan.net/travelcube/214b841….png);
        background-size: cover;
        background-position: 50% 50%;
        border-radius: 4px;
        overflow: hidden;
        img {
          width: 100%;
          font-size: 0;
        }
      }
      .info-box {
        position: relative;
        margin-top: 10px;
        .title {
          font-size: 16px;
          line-height: 22px;
          width: 100%;
          height: 22px;
          text-overflow: ellipsis;
          overflow: hidden;
          white-space: nowrap;
        }
        .score-container {
          display: flex;
          align-items: center;
          .comment-number {
            font-size: 12px;
            color: #999;
            height: 24px;
            line-height: 24px;
            margin-left: 5px;
          }
        }
        .desc {
          font-size: 12px;
          color: #999999;
          width: 100%;
          height: 18px;
          line-height: 18px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          margin-top: 4px;
        }
        .price-container {
          height: 28px;
          color: #FF6600;
          font-weight: 700;
          .span-one {
            font-size: 14px;
          }
          .span-two {
            font-size: 22px;
            font-weight: normal;
          }
          .span-three {
            font-size: 12px;
            margin-left: 4px;
          }
        }
      }
      &:hover {
        background-color: #F4F4F4;
        border-radius: 4px;
        transition: background-color .4s;
        transition-timing-function: ease-out;
      }
    }
  }
}
</style> 